package com.cntcdt.api.service.impl;

import com.cntcdt.api.db.dao.ConsociationCompanyUserDao;
import com.cntcdt.api.db.model.ConsociationCompanyUserModel;
import com.cntcdt.api.service.ConsociationCompanyUserService;

public class ConsociationCompanyUserServiceImpl implements ConsociationCompanyUserService {

	@Override
	public ConsociationCompanyUserModel findByUserNameAndPassWord(String userName, String password) {
		return ConsociationCompanyUserDao.getInstance().findByUserNameAndPassWord(userName, password);
	}

	@Override
	public ConsociationCompanyUserModel findById(Integer id) {
		return ConsociationCompanyUserDao.getInstance().findByPrimaryKey(id);
	}

	@Override
	public ConsociationCompanyUserModel findByUserName(String userName) {
		return ConsociationCompanyUserDao.getInstance().findByUserName(userName);
	}

	@Override
	public int insetModel(ConsociationCompanyUserModel consociationCompanyUser) {
		return ConsociationCompanyUserDao.getInstance().insert(consociationCompanyUser);
	}

	@Override
	public boolean updateModel(ConsociationCompanyUserModel consociationCompanyUser) {
		return ConsociationCompanyUserDao.getInstance().updateAny(consociationCompanyUser);
	}

	@Override
	public ConsociationCompanyUserModel findByCompanyId(int companyId) {
		return ConsociationCompanyUserDao.getInstance().findByCompanyId(companyId);
	}
		

}
